|
|
 |
|
|
|
|
66: For Each theRDOError In argObject
67: theAppTransactions.addTrans2Text _
68: theRDOError.Number & theRDOError.Source _
69: & theRDOError.Description
70: Next
71: theAppTransactions.addTrans2Text _
72: Processing of SQL was not successful
73: theAppTransactions.showLog
74: End If
75: End Sub |
|
|
|
|
|
|
|
|
This lesson presented you with an overview of the Error-Processing and Exception-Handling Subsystem. In particular, you learned the purpose of this subsystem and how to raise errors and exceptions. The classes in the subsystem, as well as their methods, properties, arguments, and returns, were presented, and you learned how to implement the Error-Processing and Exception-Handling Subsystem. |
|
|
|
|
|
|
|
|
Q What kinds of actions are included in error handling? |
|
|
|
|
|
|
|
|
A Error handling includes the trapping and the subsequent chain of responses to errors in your application. |
|
|
|
|
|
|
|
|
Q Should even the simplest methods have error handling? |
|
|
|
|
|
|
|
|
A Every significant class method and code module function (if any) requires initial error handling. Only the simplest methods that have been well tested or are otherwise a no-brainer should be considered for not having inline error handling. |
|
|
|
|
|
|
|
|
Q What does the Resume statement do? |
|
|
|
|
|
|
|
|
A The Resume statement tells your application to continue process instructions (lines of code) at the line where the error occurred. Visual Basic then retries that line of code. If the error condition has not been properly resolved, then the error-handling operation is initiated again. |
|
|
|
|
|
|
|
|
Q When should you use the Resume Next statement? |
|
|
|
|
|
|
|
|
A When you feel your application continually encounters a problem that you feel is truly irrelevant or you just need to move on and debug other areas of your code while in design time. Resume Next does not require any special object-oriented treatment, so it won't be discussed further unless it's truly warranted. |
|
|
|
|
|